package com.flong.juc.charter1;

/**
 * @Author:liangjl
 * @Date: 2020/7/4-21:10
 * @Eamil:jilongliang@sina.com
 * @Description:
 */
public class MyTest7 {
    public static void main(String[] args) throws InterruptedException {
        Thread thread = new MyTest7Thread();
        thread.start();
        Thread.sleep(10);
        thread.interrupt();
    }
}

class MyTest7Thread extends Thread {
    @Override
    public void run() {
        try {
            System.out.println("开始线程");
            Thread.sleep(20000);
            System.out.println("结束线程");
        } catch (InterruptedException e) {
            e.printStackTrace();
            System.out.println("异常进入到catch");
        }
    }
}


